const Person = require('./person');
class Teacher extends Person{
    constructor(id,name,age,klasses){
        super(id,name,age);
        this.klasses = klasses;
    }
    introduce(){
        if(this.klasses === undefined){
            return super.introduce()+` I am a Teacher. I teach No Class.`
        }
        else{
            let result=super.introduce()+` I am a Teacher. I teach Class `;
            for(let i in this.klasses){
                let n=this.klasses[i];
                result+=n.number;
                if(i!=(this.klasses.length-1)){
                    result+=', ';
                }
            }
            result+='.';
            return result;
        }
    }
    isTeaching(student){
        
    }
}
module.exports=Teacher;

